Skip to content

Conversation

callum-rutledge
Copy link
Contributor

Found out that if you were overloading a method the Schema gen would be non-determinsitc and could be any of your definitions. see House.java for example.

Have changed generation so now we check that all methods that will be turned to fields are unique within an entity, otherwise throw an exception.

}
var f = entityProcessor.getMethodProcessor().process(null, FieldCoordinates.coordinates(typeName, name.get()), meta, method);
if (name.isEmpty()) return false;
return validMethods.put(name.get(), method) != null;
Copy link
Contributor

@ashley-taylor ashley-taylor Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for filters like this. To reduce cognitive load they should all be pure functions. Don't mind it reading from out of scope but modifying makes reasoning hard

var method = type.getMethod(field.getName());
if (method.isAnnotationPresent(GraphQLIgnore.class)) return false;
var name = EntityUtil.getName(field.getName(), field, method);
return validMethods.put(name, method) != null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the above filter, it modifies the state outside its scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants